﻿namespace UsedBookTradeSystem.Models.Entity
{
    public class Cart
    {
        public int Id { get; set; }
        public List<Book> Books { get; set; }
        public User User { get; set; }

        public int UserId { get; set; }

        public double Total { get 
            {
                return Books.Sum(x=>(double)x.Price);
            } 
        }
    }
}
